package com.sixth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sixth.dao.HeadDao;
import com.sixth.entity.Head;
import com.sixth.service.HeadNavService;
import com.sixth.until.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: self-tui-education
 * @description:
 * @author: 高振杨
 * @create: 2022-05-08 18:01
 **/
@Service
public class HeadNavServiceImpl implements HeadNavService {
    @Autowired
    private HeadDao headDao;
    @Override
    public CommonResult getAllHead() {
        QueryWrapper<Head> headNavQueryWrapper = new QueryWrapper<>();
        headNavQueryWrapper.eq("is_diable","0");
        List<Head> headNavs = headDao.selectList(headNavQueryWrapper);
        if (headNavs!=null){
            return new CommonResult(2000,"查询成功",headNavs);
        }else {
            return new CommonResult(5000,"查询失败",null);
        }

    }
}
